package cn.tedu.dictionary.service.listener;

import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;


@Component
public class PubSubMessageListener implements MessageListener {
    public PubSubMessageListener() {
        System.out.println("PubSubMessageListener()");
    }
    @Override
    public void onMessage(Message message, byte[] pattern) {
        System.out.println("PubSubMessageListener:thread->"+Thread.currentThread().getName());
        System.out.println("channel:"+new String(message.getChannel()));
        System.out.println("message:"+new String(message.getBody()));
    }
}
